const Sequelize = require("sequelize");
const sequelize = new Sequelize(process.env.MYSQL_URI || "mysql://localhost:3306/mht-foobar", {
    // pool: {
    //     idle: 1000000,
    //     acquire:1000000,
    // }
});
const MhtFile = sequelize.define("mht-file", {
    filename: {
        type: Sequelize.STRING
    },
    boundary: {
        type: Sequelize.STRING
    },
    visited: {
        type: Sequelize.BOOLEAN
    }
});

const HtmlMsg = sequelize.define("html-message", {
    html: {
        type: Sequelize.TEXT("long")
    },
    visited: {
        type: Sequelize.BOOLEAN
    },
    boundary: {
        type: Sequelize.STRING
    }
});

const Image = sequelize.define("image", {
    cid: {
        type: Sequelize.STRING
    },
    content: {
        type: Sequelize.TEXT("long")
    },
    image_type: {
        type: Sequelize.STRING
    },
    visited: {
        type: Sequelize.BOOLEAN
    },
    boundary: {
        type: Sequelize.STRING
    }
})

module.exports = {
    MhtFile,
    Image,
    HtmlMsg
}